function confirmBooking()
{
	var assign = confirm("Click ok to confirm booking.");
	if(assign)
	{
		insertBooking();
	}
}

xmlhttp_booking = null;
function insertBooking()
{
xmlhttp_booking=GetXmlHttpObject();
if (xmlhttp_booking==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var source = document.getElementById('txt_source').value;
var booking_num = document.getElementById('txt_booking_num').value;
var qty = document.getElementById('sel_qty').value;
var size = document.getElementById('sel_size').value;

var ves_voy = document.getElementById('txt_vesvoy').value;
var ves_voy_etd = document.getElementById('txt_vesvoy_etd').value;
var pick_date = document.getElementById('txt_pick_date').value;
var pick_hour = document.getElementById('sel_pick_hour').value;
var pick_min = document.getElementById('sel_pick_min').value;

var shipper = document.getElementById('txt_shipper').value;
var shipper_code = document.getElementById('txt_shipper_code').value;
var commodity_class = document.getElementById('sel_class').value;

var pick_add = document.getElementById('txt_pick_add').value;
var con_per = document.getElementById('txt_contact_person').value;
var con_num = document.getElementById('txt_contact_num').value;

var instruction = document.getElementById('txt_instruction').value;
var type = document.getElementById('txt_type').value;


var pass_data = "";
var pass_data = pass_data +"source="+ source;
var pass_data = pass_data +"&booking_num="+ booking_num;
var pass_data = pass_data +"&qty="+ qty;
var pass_data = pass_data +"&size="+ size;
var pass_data = pass_data +"&ves_voy="+ ves_voy;
var pass_data = pass_data +"&ves_voy_etd="+ ves_voy_etd;
var pass_data = pass_data +"&pick_date="+ pick_date;
var pass_data = pass_data +"&pick_hour="+ pick_hour;
var pass_data = pass_data +"&pick_min="+ pick_min;
var pass_data = pass_data +"&shipper="+ shipper;
var pass_data = pass_data +"&shipper_code="+ shipper_code;
var pass_data = pass_data +"&commodity_class="+ commodity_class;
var pass_data = pass_data +"&pick_add="+ pick_add;
var pass_data = pass_data +"&con_per="+ con_per;
var pass_data = pass_data +"&con_num="+ con_num;
var pass_data = pass_data +"&instruction="+ instruction;
var pass_data = pass_data +"&type="+ type;

xmlhttp_booking.onreadystatechange=function (){
if (xmlhttp_booking.readyState==4)
  {
	if(xmlhttp_booking.responseText=="1")
	{
		redirectFrame("bodyFrame","booking_list.php");
		alert("Successfully submitted booking details!");
		closePopDiv();
	}
  }
};
xmlhttp_booking.open("POST","ajax_insert_booking.php",true);
xmlhttp_booking.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp_booking.send(pass_data);
}